package com.example.sys.controller;

import com.example.common.utils.R;
import com.example.sys.service.PermissionService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @Author 罗文斌
 * @Date 2023/7/24
 * @Version 1.0.0
 */
@RestController
@RequestMapping("/permission")
public class PermissionController {

    @Resource
    private PermissionService permissionService;

    @PostMapping("/get")
    public R getPermission(@RequestBody String params) {
        return permissionService.getAllPermission(params);
    }

    @PostMapping("/add")
    public R addRole(@RequestBody String params) {
        return permissionService.addRole(params);
    }

    @PostMapping("/update")
    public R updateRole(@RequestBody String params) {
        return permissionService.updateRole(params);
    }

    @PostMapping("/remove")
    public R removeRole(@RequestBody String params) {
        return permissionService.removeRole(params);
    }
}
